<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="renderer" content="webkit">
		<link href="../../css/bootstrap.min.css" rel="stylesheet">
		<link rel="stylesheet" href="../../js/jquery-easyui-1.4.4/themes/bootstrap/easyui.css">
		<link rel="stylesheet" href="../../js/jquery-easyui-1.4.4/themes/icon.css">
		<link rel="stylesheet" href="../../css/ext_icon.css">
		<script src="../../js/jquery-easyui-1.4.4/jquery.min.js"></script>
		<script src="../../js/bootstrap.min.js"></script>
		<script src="../../js/jquery-easyui-1.4.4/jquery.easyui.min.js"></script>
		<script src="../../js/jquery-easyui-1.4.4/locale/easyui-lang-zh_CN.js"></script>
		<script src="../../js/ext_jquery.js"></script>
		<script src="../../js/ext_easyui.js"></script>
		<script src="../../js/jquery.form.js"></script>
		<script src="../../js/My97DatePicker/WdatePicker.js"></script>
		<script src="../../js/Chart.min.js"></script>
		<script src="../../js/util.js"></script>
		<script src="../../js/ckeditor/ckeditor.js"></script>
		<link rel="stylesheet" href="../../css/style.css">
		<script src="../../js/main.js"></script>
		<title></title>
		<style>
			img {
				min-width: 200px;
				max-width: 400px;
			}
		</style>
	</head>

	<body>
		<script>
			$(function() {
				var submitForm = $('.form-table');
				var options = {
					dataType: 'json',
					beforeSubmit: function() {
						if (!submitForm.form('enableValidation').form('validate')) {
							parent.$.messager.progress('close');
							return false;
						}
						parent.$.messager.progress({
							title: '提示',
							text: '数据保存中，请稍后....'
						});
						return true;
					},
					success: function(result) {
						parent.$.messager.progress('close');
						if (result.success) {
							parent.$.messager.show({
								title: '提示',
								msg: '修改成功!',
								timeout: 3000
							});
							parent.$.modalDialog.openner_dataGrid
								.datagrid('reload'); //刷新表格
							parent.$.modalDialog.handler.dialog('close');
							//removeTabs();
						} else {
							parent.$.messager.alert('错误', result.msg, 'error');
						}
					}
				};
				submitForm.bind('submit', function(e) {
					e.preventDefault(); // <-- important
					$(this).ajaxSubmit(options);
				});
			});

			function submitForm() {
				//$('.form-table').submit();
				parent.$.messager.progress({
					title: '提示',
					text: '数据保存中，请稍后....'
				});
				setTimeout(function() {
					parent.$.messager.progress('close');
					parent.$.messager.show({
						title: '提示',
						msg: '修改成功!',
						timeout: 3000
					});
					removeTabs();
				}, 1200);
			}
			var imgs = 1;

			function addimages() {
				var tex = '<input class="easyui-filebox" data-options="prompt:\'上传产品图片\',buttonText:\'选择上传\'" style="width: 70%;height: 34px;">';
				$('#images').append(tex);
			}
		</script>
		<form class="form-table" style="width: 90%;" action="" method="post">
			<table class="table table-bordered table-condensed">
				<tr>
					<th width="20%">产品编号：</th>
					<td colspan="3"><input class="easyui-textbox" name="name" data-options="prompt:'输入产品编号',required:true" style="width: 100%; height: 30px;" value="21412"></td>
				</tr>
				<tr>
					<th>产品名称：</th>
					<td colspan="3"><input class="easyui-textbox" name="name" data-options="prompt:'输入产品名称',required:true" style="width: 100%; height: 30px;" value="a灯"></td>
				</tr>
				<tr>
					<th width="20%">产品公司：</th>
					<td width="30%">
						<input class="easyui-combobox" data-options="required:true,
								panelHeight:'auto',
								editable:false,
								multiple:true,
								url:'',
								data:[{'id':'1','name':'a公司'},{'id':'2','name':'b公司'},{'id':'3','name':'c公司','selected':true},{'id':'4','name':'d公司'},{'id':'5','name':'e公司'},{'id':'6','name':'f公司'},{'id':'7','name':'g公司'},{'id':'8','name':'h公司'}],
								valueField:'id',
								textField:'name'" style="width: 100%;height: 30px;"></td>
					<th width="20%">材质：</th>
					<td width="30%">
						<input class="easyui-combobox" data-options="required:true,
								panelHeight:'auto',
								editable:false,
								multiple:true,
								url:'',
								data:[{'id':'1','name':'钢材','selected':true},{'id':'2','name':'玻璃','selected':true},{'id':'3','name':'木材'},{'id':'4','name':'铜'}],
								valueField:'id',
								textField:'name'" style="width: 100%;height: 30px;"></td>
				</tr>
				<tr>
					<th>规格：</th>
					<td><input class="easyui-textbox" name="add" data-options="prompt:'输入规格'" style="width: 100%; height: 30px;"></td>
					<th>销售价格：</th>
					<td><input class="easyui-numberspinner" name="add" data-options="prompt:'输入销售价格',required:true,increment:100,precision:2,decimalSeparator:'.'" style="width: 100%; height: 30px;" value="3452.00"></td>
				</tr>
				<tr>
					<th>批发价格：</th>
					<td><input class="easyui-numberspinner" name="add" data-options="prompt:'输入批发价格',increment:100,precision:2,decimalSeparator:'.'" style="width: 100%; height: 30px;"></td>
					<th>成本价格：</th>
					<td><input class="easyui-numberspinner" name="add" data-options="prompt:'输入成本价格',increment:100,precision:2,decimalSeparator:'.'" style="width: 100%; height: 30px;"></td>
				</tr>
				<tr>
					<th rowspan="2">产品图片：</th>
					<td colspan="3" id="images"><img src="../../img/4-1.jpg">
						<!--&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:void(0);" class="btn btn-default" role="button" onclick="addimages()"><span class="glyphicon glyphicon-plus-sign"></span> 增加</a>-->
					</td>
				</tr>
				<tr>
					<td colspan="3"><input class="easyui-filebox" data-options="prompt:'不上传即不修改',buttonText:'上传修改'" style="width: 100%;height: 34px;"></td>
				</tr>
				<!--<tr>
					<td colspan="3"><input class="easyui-filebox" data-options="prompt:'上传产品图片',buttonText:'选择上传'" style="width: 100%;height: 34px;"></td>
				</tr>-->
				<tr>
					<th>描述：</th>
					<td colspan="3"><textarea name="description" class="ckeditor" rows="3">畅销产品</textarea></td>
				</tr>
			</table>
		</form>
		<div style="text-align: center;padding-bottom: 10px;">
			<a href="javascript:void(0);" class="btn btn-primary" role="button" onclick="submitForm();return false;">提&nbsp;&nbsp;&nbsp;&nbsp;交</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<a href="javascript:void(0);" class="btn btn-primary" role="button" onclick="removeTabs();">返&nbsp;&nbsp;&nbsp;&nbsp;回</a>
		</div>
	</body>

</html>